<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>&lt;poll.h&gt;</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_007_982">&nbsp;</a>NAME</h4><blockquote>
poll.h - definitions for the poll() function
</blockquote><h4><a name = "tag_000_007_983">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;poll.h&gt;
</code>
</pre>
</blockquote><h4><a name = "tag_000_007_984">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>&lt;poll.h&gt;</i>
header defines the
<b>pollfd</b>
structure that includes at least the following member:
<pre>
<code>
int         fd        the following descriptor being polled
short int   events    the input event flags (see below)
short int   revents   the output event flags (see below)
</code>
</pre>
<p>
The
<i>&lt;poll.h&gt;</i>
header defines the following type through typedef:
<dl compact>

<dt><b>nfds_t</b><dd>An unsigned integral type used for the number of file descriptors.

</dl>
<p>
The following symbolic constants are defined, zero or more of
which may be OR-ed together to form the <b>events</b> or
<b>revents</b> members in the <b>pollfd</b> structure:
<dl compact>

<dt>POLLIN<dd>
Same effect as POLLRDNORM | POLLRDBAND.

<dt>POLLRDNORM<dd>
Data on priority band 0 may be read.

<dt>POLLRDBAND<dd>
Data on priority bands greater than 0 may be read.

<dt>POLLPRI<dd>
High priority data may be read.

<dt>POLLOUT<dd>
Same value as POLLWRNORM.

<dt>POLLWRNORM<dd>
Data on priority band 0 may be written.

<dt>POLLWRBAND<dd>
Data on priority bands greater than 0 may be written.
This event only examines bands that have been written to at least
once.

<dt>POLLERR<dd>
An error has occurred (<b>revents</b> only).

<dt>POLLHUP<dd>
Device has been disconnected (<b>revents</b> only).

<dt>POLLNVAL<dd>
Invalid <b>fd</b> member (<b>revents</b> only).

</dl>
<p>
The &lt;<b>poll.h</b>&gt; header declares the following function which
may also be defined as a macro.
Function prototypes must be provided for use with an ISO C
compiler.
<pre>
<code>
int   <a href="poll.html">poll</a>(struct pollfd[], nfds_t, int);
</code>
</pre>
</blockquote><h4><a name = "tag_000_007_985">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_007_986">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_007_987">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="poll.html">poll()</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
